package Properties;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.Properties;

public class test {
    public static void main(String[] args) {
        Properties properties = new Properties();
        try {
            // 使用 InputStreamReader 指定 UTF-8 编码
            properties.load(new InputStreamReader(
                    new FileInputStream("D:\\code\\java_learning\\Math\\src\\Properties\\naem.properties"),
                    StandardCharsets.UTF_8));
            // 打印属性文件内容
            properties.list(System.out);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
